<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>实现移动端Retina屏幕1px边框的7种方法-2</title>
        <style>
            .mb20{
                margin-bottom: 20px;
            }
            .border1{
                border:1px solid #ccc;
            }
            .box-shadow-1px {
              box-shadow: inset 0px -1px 1px -1px #c8c7cc;
            }
            .box-shadow-1px-1 {
              box-shadow: inset 0px -1px 0px 0px #c8c7cc;
            }
            .box-shadow-1px-2 {
              box-shadow: inset 0px -1px 1px 0px #c8c7cc;
            }
            .box-shadow-1px-3 {
              box-shadow: inset 0px -1px 1px -1px #c8c7cc;
            }
        </style>
    </head>
    <body>
        <h1>实现移动端Retina屏幕1px边框的7种方法</h1>
        <p>来源:<a href="http://www.yyyweb.com/4950.html"></a></p>
        <h2>5、使用box-shadow模拟边框</h2>
        <p>利用css 对阴影处理的方式实现0.5px的效果</p>
        <p>样式设置：</p>
        <pre>.box-shadow-1px {
              box-shadow: inset 0px -1px 1px -1px #c8c7cc;
            }</pre>
        <p>优点：</p>
        <p>代码量少</p>
        <p>可以满足所有场景</p>
        <p>缺点：</p>
        <p>边框有阴影，颜色变浅</p>
        <div class="border1">1px边框-border:1px solid #ccc;</div>
        <div class="box-shadow-1px">1px边框-box-shadow: inset 0px -1px 1px -1px #c8c7cc;</div>
        <div class="box-shadow-1px-1">1px边框-box-shadow: inset 0px -1px 0px 0px #c8c7cc;</div>
        <div class="box-shadow-1px-2">1px边框-box-shadow: inset 0px -1px 1px 0px #c8c7cc;</div>
        <div class="box-shadow-1px-3">1px边框-box-shadow: inset 0px -1px 1px -1px #c8c7cc;</div>
    </body>
</html>